/**
 * Copyright &copy; 2016-2017 <a href="http://git.oschina.net/whoamien/backend_management">Backend Management</a> All rights reserved.
 */
package com.xw.framework.base.page;

import org.springframework.data.domain.PageRequest;

import com.fasterxml.jackson.annotation.JsonIgnore;

/**
 * The Class BaseQuery.
 *
 * @author Xi Wei
 */
public class BaseQuery implements java.io.Serializable,Cloneable {

	private static final long serialVersionUID = -360860474471966681L;
	
	/** The Constant DEFAULT_PAGE_SIZE. */
	public static final int DEFAULT_PAGE_SIZE = 10;
	
	private int page = 1;//the page number start with 1;
	private int size = DEFAULT_PAGE_SIZE;
	private String sortColumns;
	
	
	/**
	 * Gets the cache name.
	 *
	 * @return the cache name
	 */
	@JsonIgnore
	public String getCacheName() {
		return this.getClass().getSimpleName() + "Cache";
	}
	
	/* (non-Javadoc)
	 * @see java.lang.Object#clone()
	 */
	public Object clone() {
		try {
			return super.clone();
		} catch (CloneNotSupportedException e) {
			return null;
		}
	}

	/**
	 * Gets the page.
	 *
	 * @return the page
	 */
	public int getPage() {
		return page;
	}

	/**
	 * Sets the page.
	 *
	 * @param currentPage the new page
	 */
	public void setPage(int currentPage) {
		this.page = currentPage;
	}

	/**
	 * Gets the size.
	 *
	 * @return the size
	 */
	public int getSize() {
		return size;
	}

	/**
	 * Sets the size.
	 *
	 * @param size the new size
	 */
	public void setSize(int size) {
		this.size = size;
	}

	/**
	 * Gets the sort columns.
	 *
	 * @return the sort columns
	 */
	public String getSortColumns() {
		return sortColumns;
	}

	/**
	 * Sets the sort columns.
	 *
	 * @param sortColumns the new sort columns
	 */
	public void setSortColumns(String sortColumns) {
		this.sortColumns = sortColumns;
	}

	
	
	
}
